package com.ruoyi.exam.service.impl;

import java.util.List;
import com.ruoyi.common.core.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.exam.mapper.PaperDetailQuestionMapper;
import com.ruoyi.exam.domain.PaperDetailQuestion;
import com.ruoyi.exam.service.IPaperDetailQuestionService;

/**
 * 考试试卷题目Service业务层处理
 * 
 * @author ruoyi
 * @date 2024-07-10
 */
@Service
public class PaperDetailQuestionServiceImpl implements IPaperDetailQuestionService 
{
    @Autowired
    private PaperDetailQuestionMapper paperDetailQuestionMapper;

    /**
     * 查询考试试卷题目
     * 
     * @param id 考试试卷题目主键
     * @return 考试试卷题目
     */
    @Override
    public PaperDetailQuestion selectPaperDetailQuestionById(Long id)
    {
        return paperDetailQuestionMapper.selectPaperDetailQuestionById(id);
    }

    /**
     * 查询考试试卷题目列表
     * 
     * @param paperDetailQuestion 考试试卷题目
     * @return 考试试卷题目
     */
    @Override
    public List<PaperDetailQuestion> selectPaperDetailQuestionList(PaperDetailQuestion paperDetailQuestion)
    {
        return paperDetailQuestionMapper.selectPaperDetailQuestionList(paperDetailQuestion);
    }

    /**
     * 新增考试试卷题目
     * 
     * @param paperDetailQuestion 考试试卷题目
     * @return 结果
     */
    @Override
    public int insertPaperDetailQuestion(PaperDetailQuestion paperDetailQuestion)
    {
        paperDetailQuestion.setCreateTime(DateUtils.getNowDate());
        return paperDetailQuestionMapper.insertPaperDetailQuestion(paperDetailQuestion);
    }

    /**
     * 修改考试试卷题目
     * 
     * @param paperDetailQuestion 考试试卷题目
     * @return 结果
     */
    @Override
    public int updatePaperDetailQuestion(PaperDetailQuestion paperDetailQuestion)
    {
        paperDetailQuestion.setUpdateTime(DateUtils.getNowDate());
        return paperDetailQuestionMapper.updatePaperDetailQuestion(paperDetailQuestion);
    }

    /**
     * 批量删除考试试卷题目
     * 
     * @param ids 需要删除的考试试卷题目主键
     * @return 结果
     */
    @Override
    public int deletePaperDetailQuestionByIds(Long[] ids)
    {
        return paperDetailQuestionMapper.deletePaperDetailQuestionByIds(ids);
    }

    /**
     * 删除考试试卷题目信息
     * 
     * @param id 考试试卷题目主键
     * @return 结果
     */
    @Override
    public int deletePaperDetailQuestionById(Long id)
    {
        return paperDetailQuestionMapper.deletePaperDetailQuestionById(id);
    }
}
